package com.kczd.activity;

import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.widget.ImageView;
import android.widget.TextView;

import com.kczd.client.R;
import com.kczd.fragment.OrderOverFragment;
import com.kczd.util.SysApplication;

//已取消
public class OrderOverDetailActivity extends AppCompatActivity implements View.OnClickListener{


    private ImageView mback;
    private TextView tv_datetime;
    private TextView tv_oriposition;
    private TextView tv_terposition;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_order_over_detail);
        //新页面接收数据
        Bundle bundle = this.getIntent().getExtras();
        //接收name值
        int position = bundle.getInt("position");

        initView();
       initViewData(position);

        // 多activity管理
        SysApplication.getInstance().addActivity(this);
    }

    private void initViewData(int position) {
        tv_datetime.setText(OrderOverFragment.orderOverlsit.get(position).getDatetime());
        tv_oriposition.setText(OrderOverFragment.orderOverlsit.get(position).getOrigin());
        tv_terposition.setText(OrderOverFragment.orderOverlsit.get(position).getTerminal());
    }

    private void initView() {
        tv_datetime = (TextView) findViewById(R.id.tv_datetime);
        tv_oriposition = (TextView) findViewById(R.id.tv_oriposition);
        tv_terposition = (TextView) findViewById(R.id.tv_terposition);

        mback= (ImageView) findViewById(R.id.iv_back);
        mback.setOnClickListener(this);

    }
    @Override
    public void onClick(View v) {

        switch (v.getId()) {

            case R.id.iv_back:
                this.finish();
                break;

            default:
                break;
        }
    }
}
